{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
function myFunction()
{
	if(confirm("You Want To Remove This Record")== true)
	{
		return true;
	}
	else
	{
		return false;
	}	
}	
$(document).ready(function(){
	$(".add").click(function(){
    $("#one").clone(true).appendTo("#mainDiv")
     .find('input[type="text"]').val('').end()
  });
  $('.delete').click(function(){
    $(this).parents("#one").remove();  
  });
//---------Remove function Over------------------    
  $("#partyId").change(function(){
    var dataString = "partyId=" + $("#partyId").val();
    $.ajax({
      type: "GET",
      url:  "dataChallanAj.php",
      data: dataString,
      success: function(data){
        $("#dataChallan").html(data);
      }
    });
  });
});
</script>
{/block}
{block name=body}
<form name="form1" action="{$smarty.server.PHP_SELF}" method="post">
<input type="hidden" name="outgoingId"  />	
<table align="center">
<tr>
  <td colspan="3" align="center" class="table1">Out Going Register</td>
</tr>
<tr>
  <td class="table1">Date :
  {html_select_date prefix="outgoingDate" start_year="-2" end_year="+1" field_order="DMY" day_value_format="%02d" }
  </td>
  <td class="table1">Party :
  <select name="partyId" id="partyId" required="required">
  <option value="">select</option>
  {html_options values=$catTitleArray.partyId output=$catTitleArray.partyName}
  </select></td>
  <td colspan="1" class="table1" name="challan" id="dataChallan"></td>
</tr>
<tr>
  <td class="table1" colspan="3" align="center"> Outgoing Challan :<input type="text" name="outgoingChallan" required="required"></td>
</tr>
<tr>
  <td align="center" colspan="3" class="table1"><input size="10" type="submit" class="button" name="submitBtn" value="Submit"></td>
</tr>
</table>
</form>
<br>
<table border='0' cellpadding='1' cellspacing='2' align='center'>
<tr>
  <td colspan="5" class="table1" align="center">* * OutGoing Register List * *</td>
</tr>
<tr>
  <td  class="table1" align='center'><B>&nbsp;</td>	
	<td  class="table1" align='center'><B>OutGoing Date</td>
	<td  class="table1" align='center'><B>PartyName</td>
	<td  class="table1" align='center'><B>Challan</td>
	<td  class="table1" align='center'><B>OutgoingChallan</td>
</tr>
{section name="sec" loop=$incomingRegister}
<tr>
	<td class="table2" align="center">
  <a href="outGoingEntryDelete.php?outgoingId={$incomingRegister[sec].outgoingId}" onclick="return myFunction();" class="link"><img src="./images/deleteIco.png"></a>
	</td>
 <td class="table2" align="center">{$incomingRegister[sec].outgoingDate}</td>
 <td class="table2" align="left">{$incomingRegister[sec].partyName}</td>
 <td class="table2" align="right">{$incomingRegister[sec].challan}</td>
 <td class="table2" align="right">{$incomingRegister[sec].outgoingChallan}</td>
</tr>
{sectionelse}
<tr>
  <td>
    {$msg}
  </td>
</tr> 
{/section}
</table>
{/block}